﻿/**
 * 
 */
package com.roc.dao;

/**
 * @author Administrator
 *
 */

import java.io.Serializable;
import java.util.List;




/**
 * dao基类接口
 * @date 2011/04/07
 */
public interface IBaseDao {
	
	/**
	 * 保存实例
	 * 
	 * @param Serializable
	 * @throws DaoException
	 */
	public void editSave(Serializable object) throws DaoException;
	
	/**
	 * 修改实例
	 * 
	 * @param Serializable
	 * @throws DaoException
	 */
	public void editUpdate(Serializable object) throws DaoException;
	public void updateSQLQuery(String  sql) throws DaoException;
	/**
	 * 保存或修改实例
	 * 
	 * @param Serializable
	 * @throws DaoException
	 */
	public void edit(Serializable object) throws DaoException;

	/**
	 * 删除实例
	 * 
	 * @param Serializable
	 * @throws DaoException
	 */
	public void delete(Serializable object) throws DaoException;
	
	/**
	 * 自定义HQL查询
	 * 
	 * @param String
	 * @throws DaoException
	 */
	public List<Object> queryAll(String hql) throws DaoException;
	public List<Object> queryAll(String hql, Object[] params) throws DaoException;
	/**
	 * 自定义HQL查询(分页)
	 * 
	 * @param String
	 * @throws DaoException
	 */
	public List queryAll(String hql,int first,int max) throws DaoException;
	
	/**
	 * 查询全部对象
	 * 
	 * @param String
	 * @throws DaoException
	 */
	public List  queryAll(Class object) throws DaoException;
	
	public Object createSQLQueryUniqueResult(String hql) throws DaoException;
	
	public Object createQueryUniqueResult(String hql) throws DaoException;
	public Object createQueryUniqueResult(String hql,Object[] params) throws DaoException;
	
	public Object loadById(long id,Class c)throws DaoException;
	/**
	 * 
	 * @param code  操作日志编码
	 * @param codeName  操作名称
	 * @param operators  操作员账号
	 * @param context   内容
	 * @throws DaoException
	 */
	public void addSyslog(String code,String codeName,String operators,String context)throws DaoException;
}
